<!DOCTYPE html>
<html lang="zh-CN">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1, user-scalable=no">
    <meta http-equiv="X-UA-Compatible" content="ie=edge,chrome=1">
    <meta name="author" content="邵铭">
    <title></title>
    <style>
        .box {
            width: 400px;
            border: 1px solid;
            margin: 50px auto;
        }
        
        .tab {
            background-color: black;
            margin: 0;
            padding: 0;
            list-style: none;
        }
        
        li {
            float: left;
            width: 60px;
            text-align: center;
            line-height: 26px;
            color: white;
        }
        
        .active {
            color: black;
            background-color: #aaa;
        }
        
        p {
            display: none;
        }
        
        p:first-child {
            display: block;
        }
        
        .clearfix::after {
            content: '';
            clear: both;
            display: block;
            height: 0;
            visibility: hidden;
        }
    </style>
</head>

<body>
    <div class="box">
        <ul class="tab clearfix">
            <li class="active">选项一</li>
            <li>选项二</li>
            <li>选项三</li>
        </ul>
        <div class="content">
            <p>内容一<br>内容一<br>内容一<br></p>
            <p>内容二<br>内容二<br>内容二<br>内容二<br>内容二<br></p>
            <p>内容三<br>内容三<br>内容三<br></p>
        </div>
    </div>
</body>
<script src="./jquery.js"></script>

</html>
<script>

    $('li').each(function (index) {
        $(this).mouseover(function () {
            $(this).css({'background-color':'#aaa','color':'black'})
                .siblings().css({'background-color':'black','color':'white'});
            $('p').eq(index).css('display', 'block')
                .siblings().css('display', 'none');
        });
    });
</script>